package cn.amarone.scaffold.entity.vo;

import cn.amarone.scaffold.entity.SysRole;
import cn.amarone.scaffold.entity.dict.StatusEnum;
import com.mybatisflex.annotation.ColumnMask;
import com.mybatisflex.annotation.RelationManyToMany;
import com.mybatisflex.core.mask.Masks;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @author Amarone
 * @version 1.0
 * @description: TODO
 * @date 2023/8/2 15:04
 */
@Data
@Schema(title = "用户信息")
public class SysUserVo {

    @Schema(description = "用户ID", example = "43536994589908992")
    private Long id;

    @Schema(description = "用户昵称", example = "Amarone")
    private String nickName;

    @ColumnMask(Masks.MOBILE)
    @Schema(description = "用户联系手机号", example = "19365410929")
    private String mobilePhoneNumber;

    @ColumnMask(Masks.ADDRESS)
    @Schema(description = "用户联系地址", example = "云南省怒江傈僳族自治州泸水市片马镇")
    private String addres;

    @ColumnMask(Masks.EMAIL)
    @Schema(description = "邮箱", example = "1301@219g.vip")
    private String email;

    @ColumnMask(Masks.CHINESE_NAME)
    @Schema(description = "真实姓名", example = "邵雨泽")
    private String userName;

    @Schema(description = "年龄")
    private Integer age;

    @Schema(description = "生日", example = "2023年8月1日")
    private String birthday;

    @Schema(description = "启用标志")
    private StatusEnum status;

    // 业务字段
    @RelationManyToMany(
            joinTable = "sys_user_role",
            selfField = "id", joinSelfColumn = "user_id",
            targetField = "id", joinTargetColumn = "role_id"
    )
    @Schema(description = "角色信息")
    private List<SysRole> roles;


    @Schema(description = "创建日期")
    private Date createTime;
    @Schema(description = "创建者")
    private Long createBy;
    @Schema(description = "修改日期")
    private Date updateTime;
    @Schema(description = "修改者")
    private Long updateBy;
}
